#include <stdio.h>
#include <stdlib.h>

#define N 1010

char *findstr(char *s, char *t)
{
    char *p = NULL, *q = NULL;
    while (*s)
    {
        p = s, q = t;
        while (*p && *q && *p == *q)
            p++, q++;
        if (*q == '\0')
            return s;
        s++;
    }
    return NULL;
}

int main()
{
    char *s = NULL, *t = NULL;
    s = (char *)malloc(sizeof(char) * N);
    if (s == NULL)
        return 1;
    t = (char *)malloc(sizeof(char) * N);
    if (t == NULL)
        return 1;

    while (scanf("%s%s", s, t) == 2)
    {
        printf("%p %p\n", s, findstr(s, t));
    }

    free(s);
    s = NULL; //养成释放内存以后指针赋值NULL的好习惯
    free(t);
    t = NULL;
    return 0;
}
